package com.enjoyor.soa.traffic.rest.tsms.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.enjoyor.soa.traffic.api.dto.tsms.CommonPlaceDto;
import com.enjoyor.soa.traffic.api.dto.tsms.PoliceAssessDto;
import com.enjoyor.soa.traffic.frame.annotation.Auth;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.IMessageForIndexConsumeService;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;

@Auth
@RestController
@RequestMapping({ "/numbers" })
@Api("NumbersForIndexController相关api")
@CrossOrigin
public class NumbersForIndexController {

	@Autowired IMessageForIndexConsumeService iMessageForIndexConsumeService;
	/**
	 * 获取警员、信号机、视频总数量和可用数量
	 * @return zyh
	 */
	@GetMapping(value = { "/getMessageForIndex" }, produces = { "application/json; charset=UTF-8" })
	@ResponseBody
	@ApiResponse(response=PoliceAssessDto.class, code = 0, message = "")
    @ApiOperation("获取警员、信号机、视频总数量和可用数量")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "executeTaskId", value = "执行任务编号", paramType = "query", dataType = "string"),
        @ApiImplicitParam(name = "routeId", value = "线路编号", paramType = "query", dataType = "string"),
        @ApiImplicitParam(name = "deptId", value = "部门编号", paramType = "query", dataType = "string")})
	public ResultPojo getMessageForIndex(
			@RequestParam(defaultValue = "") String executeTaskId, 
			@RequestParam(defaultValue = "") String routeId,
			@RequestParam(defaultValue = "")String deptId, 
    		HttpServletRequest request) {
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iMessageForIndexConsumeService.getNumbersList(executeTaskId, routeId, deptId);
		return resultPojo;
	}
	
}
